home *** CD-ROM | disk | FTP | other *** search
/ PC for Alla 2005 May / PC för Alla 0505.iso / fullversioner / realsoft3d / data1.cab / Scripting / scripts / js / real / raytr / r3surf.js < prev    next >
Encoding:
JavaScript  |  2005-04-04  |  11.2 KB  |  417 lines

  1.  
  2. // JavaScript wrapper for r3surf.h
  3. // Auto generated file, do not modify by hand
  4. // Copyright ⌐ 2004, Realsoft Graphics Oy
  5.  
  6. var R3_SURFACE_H = 1;
  7. include("real/raytr/r3frsurf.js")
  8. include("oops/r3vector.js")
  9. include("real/frio/r3raysmp.js")
  10.  
  11.  
  12. var R3CLID_SURFACE = 406;
  13.  
  14.  
  15.  
  16.  
  17. // Description: General rayhit finder. Ray position & direction can be arbitrary.
  18. // Virtual method
  19.  
  20. R3SURFM_RAYHIT = 406000;
  21.  
  22. function mR3SURFM_RAYHIT() {
  23.   DoA(this.r3obj, 406000, 0, R3TID_INTEGER, 0);
  24. }
  25.  
  26. // Description: Perspective camera rayhit finder (ray source position = (0,0,0)).    * Only hits greater than RHITMSG->mindist
  27. //      are accepted.
  28. // Virtual method
  29.  
  30. R3SURFM_RAYHITOPT = 406001;
  31.  
  32. function mR3SURFM_RAYHITOPT() {
  33.   DoA(this.r3obj, 406001, 0, R3TID_INTEGER, 0);
  34. }
  35.  
  36. // Description: Same as above, but this method is called if the surface is known to
  37. //      be fully in front of the camera.    
  38. // Virtual method
  39.  
  40. R3SURFM_RAYHITOPTM = 406002;
  41.  
  42. function mR3SURFM_RAYHITOPTM() {
  43.   DoA(this.r3obj, 406002, 0, R3TID_INTEGER, 0);
  44. }
  45.  
  46. // Description: Parallel camera rayhit finder (ray dir = (0,0,1), ray source = (x,y,0) ).    * Only
  47. //      hits greater than RHITMSG->mindist are accepted.
  48. // Virtual method
  49.  
  50. R3SURFM_AXHITOPT = 406003;
  51.  
  52. function mR3SURFM_AXHITOPT() {
  53.   DoA(this.r3obj, 406003, 0, R3TID_INTEGER, 0);
  54. }
  55.  
  56. // Description: general light ray finder.    * All hits closer than RHITMSG->nrsthit->dist should be processed.
  57. // Virtual method
  58.  
  59. R3SURFM_LIGHTHIT = 406004;
  60.  
  61. function mR3SURFM_LIGHTHIT() {
  62.   DoA(this.r3obj, 406004, 0, R3TID_INTEGER, 0);
  63. }
  64.  
  65. // Description: light rayhit finder (all light rays originate from the same position).    * All hits closer
  66. //      than RHITMSG->nrsthit->dist should be processed.
  67. // Virtual method
  68.  
  69. R3SURFM_LIGHTHITOPT = 406005;
  70.  
  71. function mR3SURFM_LIGHTHITOPT() {
  72.   DoA(this.r3obj, 406005, 0, R3TID_INTEGER, 0);
  73. }
  74.  
  75. // Description: Same as above, but this method is called if the surface is known to
  76. //      be fully in front of the light ray origin at the direction of the given
  77. //      ray (e.g. when the ray is cast by an optimized spot light).    
  78. // Virtual method
  79.  
  80. R3SURFM_LIGHTHITOPTM = 406006;
  81.  
  82. function mR3SURFM_LIGHTHITOPTM() {
  83.   DoA(this.r3obj, 406006, 0, R3TID_INTEGER, 0);
  84. }
  85.  
  86.  
  87. R3SURFM_TRIM = 406007;
  88.  
  89. function mR3SURFM_TRIM() {
  90.   DoA(this.r3obj, 406007, 0, R3TID_INTEGER, 0);
  91. }
  92.  
  93.  
  94. R3SURFM_AXTRIM = 406008;
  95.  
  96. function mR3SURFM_AXTRIM() {
  97.   DoA(this.r3obj, 406008, 0, R3TID_INTEGER, 0);
  98. }
  99.  
  100.  
  101. R3SURFM_ORIGTRIM = 406009;
  102.  
  103. function mR3SURFM_ORIGTRIM() {
  104.   DoA(this.r3obj, 406009, 0, R3TID_INTEGER, 0);
  105. }
  106.  
  107. // Description: Evaluates properties in a point on the surface
  108.  
  109. R3SURFM_EVALUATESURFACEPOINT = 406010;
  110.  
  111. function mR3SURFM_EVALUATESURFACEPOINT() {
  112.   DoA(this.r3obj, 406010, 0, R3TID_INTEGER, 0);
  113. }
  114.  
  115. // Description: Evaluate only UV channel
  116. // p3: r3Vect, result UV coords
  117.  
  118. R3SURFM_EVALUATEUV = 406011;
  119.  
  120. function mR3SURFM_EVALUATEUV(p3) {
  121.   DoA(this.r3obj, 406011, p3, R3TID_VECTOR, 0);
  122. }
  123.  
  124. // Description: Surface visibility check for perspective camera rays from origin. Note that ray * tracer
  125. //      optimizes bounding sphere, bounding box etc. visibility so only very object specific * visibility properties
  126. //      should be optimized here.
  127. // p2: Object, pointer to a temp memory buffer (size = R3SURFCA_MaxPosdatasize defined by this class). *
  128. //      Store temporary values here to avoid time consuming recomputation later at ALLOCPOSDATA
  129. // p3: Tag[], tag list includes R3SURFA_OptDataVector vector tag defining    
  130.  
  131. R3SURFM_QUERYPOSDATA = 406012;
  132.  
  133. function mR3SURFM_QUERYPOSDATA(p2, p3) {
  134.   Do3(this.r3obj, 406012, 0, R3TID_INTEGER, 0, p2, R3TID_OBJECT, 0, p3, R3TID_TAG, R3TNF_ARRAY);
  135. }
  136.  
  137.  
  138. R3SURFM_QUERYAXDATA = 406013;
  139.  
  140. function mR3SURFM_QUERYAXDATA() {
  141.   DoA(this.r3obj, 406013, 0, R3TID_INTEGER, 0);
  142. }
  143.  
  144.  
  145. R3SURFM_QUERYSHADOWDATA = 406014;
  146.  
  147. function mR3SURFM_QUERYSHADOWDATA() {
  148.   DoA(this.r3obj, 406014, 0, R3TID_INTEGER, 0);
  149. }
  150.  
  151. // Description: Initialize optimization data for perspective camera ray hits p1: void *, the temp memory
  152. //      buffer that was available as p2 parameyter in R3SURFM_QUERYPOSDATA p2: R3POSDATA *, the optimization data
  153. //      to be initialized. You can put temporary values that depend on the surface and ray
  154. //      hit source position here to avoid repeating computation at rendering time. Rc: geometrical complexity estimate-
  155. //      see defs below 
  156.  
  157. R3SURFM_INITPOSDATA = 406015;
  158.  
  159. function mR3SURFM_INITPOSDATA() {
  160.   DoA(this.r3obj, 406015, 0, R3TID_INTEGER, 0);
  161. }
  162.  
  163.  
  164. R3SURFM_INITAXDATA = 406016;
  165.  
  166. function mR3SURFM_INITAXDATA() {
  167.   DoA(this.r3obj, 406016, 0, R3TID_INTEGER, 0);
  168. }
  169.  
  170.  
  171. R3SURFM_INITSHADOWDATA = 406017;
  172.  
  173. function mR3SURFM_INITSHADOWDATA() {
  174.   DoA(this.r3obj, 406017, 0, R3TID_INTEGER, 0);
  175. }
  176.  
  177.  
  178. R3SURFCM_REGISTERCACHECLASS = 406018;
  179.  
  180. function mR3SURFCM_REGISTERCACHECLASS() {
  181.   DoA(this.r3obj, 406018, 0, R3TID_INTEGER, 0);
  182. }
  183.  
  184.  
  185. R3SURFCM_CREATECACHE = 406019;
  186.  
  187. function mR3SURFCM_CREATECACHE() {
  188.   DoA(this.r3obj, 406019, 0, R3TID_INTEGER, 0);
  189. }
  190.  
  191.  
  192. R3SURFCM_DELETECACHE = 406020;
  193.  
  194. function mR3SURFCM_DELETECACHE() {
  195.   DoA(this.r3obj, 406020, 0, R3TID_INTEGER, 0);
  196. }
  197.  
  198.  
  199. R3SURFCM_RESETCACHE = 406021;
  200.  
  201. function mR3SURFCM_RESETCACHE() {
  202.   DoA(this.r3obj, 406021, 0, R3TID_INTEGER, 0);
  203. }
  204.  
  205.  
  206. R3SURFCM_ALLOCCACHE = 406022;
  207.  
  208. function mR3SURFCM_ALLOCCACHE() {
  209.   DoA(this.r3obj, 406022, 0, R3TID_INTEGER, 0);
  210. }
  211.  
  212.  
  213. R3SURFCM_FREECACHE = 406023;
  214.  
  215. function mR3SURFCM_FREECACHE() {
  216.   DoA(this.r3obj, 406023, 0, R3TID_INTEGER, 0);
  217. }
  218.  
  219.  
  220. R3SURFCM_INITCACHE = 406024;
  221.  
  222. function mR3SURFCM_INITCACHE() {
  223.   DoA(this.r3obj, 406024, 0, R3TID_INTEGER, 0);
  224. }
  225.  
  226.  
  227. R3SURFM_GETHOLLOWNESS = 406025;
  228.  
  229. function mR3SURFM_GETHOLLOWNESS() {
  230.   DoA(this.r3obj, 406025, 0, R3TID_INTEGER, 0);
  231. }
  232.  
  233. // Description: Increases cache counter so that next time when cache is needed, it is recreated
  234. //      to    * take account the new situation. Example: When a new max point count is detected
  235. //      in CREATE method,    * class sends this message to surface base class.
  236.  
  237. R3SURFCM_INCREASECACHE = 406026;
  238.  
  239. function mR3SURFCM_INCREASECACHE() {
  240.   DoA(this.r3obj, 406026, 0, R3TID_INTEGER, 0);
  241. }
  242.  
  243. // Description: Evaluates properties in two near points of the ray hit point. * R3SURFM_EVALUATESURFACEPOINT is
  244. //      always called before use of this method.
  245. // p2: Object, u direction raysample initialized by R3SURFM_EVALUATESURFACEPOINT
  246. // p3: Object, v direction raysample initialized by R3SURFM_EVALUATESURFACEPOINT
  247.  
  248. R3SURFM_EVALUATEDERIVATE = 406027;
  249.  
  250. function mR3SURFM_EVALUATEDERIVATE(p2, p3) {
  251.   DoA3(this.r3obj, 406027, 0, R3TID_INTEGER, 0, p2, R3TID_OBJECT, 0, p3, R3TID_OBJECT, 0);
  252. }
  253.  
  254.  
  255. R3SURFM_NOSHADOWS = 406028;
  256.  
  257. function mR3SURFM_NOSHADOWS() {
  258.   DoA(this.r3obj, 406028, 0, R3TID_INTEGER, 0);
  259. }
  260.  
  261.  
  262. R3SURFM_GETEXTFLAGS = 406029;
  263.  
  264. function mR3SURFM_GETEXTFLAGS() {
  265.   DoA(this.r3obj, 406029, 0, R3TID_INTEGER, 0);
  266. }
  267.  
  268.  
  269. R3SURFM_SETEXTFLAGS = 406030;
  270.  
  271. function mR3SURFM_SETEXTFLAGS() {
  272.   DoA(this.r3obj, 406030, 0, R3TID_INTEGER, 0);
  273. }
  274.  
  275.  
  276.  
  277.  
  278. R3SURFA_Radius = 406500;
  279. function SetR3SURFA_Radius(value) {
  280.   R3Set(this.r3obj, R3SURFA_Radius, value, R3TID_FLOAT, 0); 
  281. }
  282.  
  283. function GetR3SURFA_Radius() {
  284.   return R3Get(this.r3obj, R3SURFA_Radius, R3TID_FLOAT, 0); 
  285. }
  286.  
  287. R3SURFA_Mask = 406501;
  288. function SetR3SURFA_Mask(value) {
  289.   R3Set(this.r3obj, R3SURFA_Mask, value, R3TID_VECTOR, R3TNF_ARRAY); 
  290. }
  291.  
  292. function GetR3SURFA_Mask() {
  293.   return R3Get(this.r3obj, R3SURFA_Mask, R3TID_VECTOR, R3TNF_ARRAY); 
  294. }
  295.  
  296. R3SURFA_MaskPoints = 406502;
  297. function SetR3SURFA_MaskPoints(value) {
  298.   R3Set(this.r3obj, R3SURFA_MaskPoints, value, R3TID_INTEGER, 0); 
  299. }
  300.  
  301. function GetR3SURFA_MaskPoints() {
  302.   return R3Get(this.r3obj, R3SURFA_MaskPoints, R3TID_INTEGER, 0); 
  303. }
  304.  
  305. R3SURFA_Cog = 406503;
  306. function GetR3SURFA_Cog() {
  307.   return R3Get(this.r3obj, R3SURFA_Cog, R3TID_VECTOR, 0); 
  308. }
  309.  
  310. R3SURFA_Parent = 406504;
  311. function SetR3SURFA_Parent(value) {
  312.   R3Set(this.r3obj, R3SURFA_Parent, value, R3TID_OBJECT, 0); 
  313. }
  314.  
  315. function GetR3SURFA_Parent() {
  316.   return R3ToJS(R3Get(this.r3obj, R3SURFA_Parent, R3TID_OBJECT, 0)); 
  317. }
  318.  
  319. R3SURFA_Trim = 406505;
  320. function SetR3SURFA_Trim(value) {
  321.   R3Set(this.r3obj, R3SURFA_Trim, value, R3TID_OBJECT, 0); 
  322. }
  323.  
  324. function GetR3SURFA_Trim() {
  325.   return R3ToJS(R3Get(this.r3obj, R3SURFA_Trim, R3TID_OBJECT, 0)); 
  326. }
  327.  
  328. R3SURFA_InvertUVTrim = 406513;
  329. function SetR3SURFA_InvertUVTrim(value) {
  330.   R3Set(this.r3obj, R3SURFA_InvertUVTrim, value, R3TID_INTEGER, 0); 
  331. }
  332.  
  333. R3SURFA_TrimOperation = 406530;
  334. function SetR3SURFA_TrimOperation(value) {
  335.   R3Set(this.r3obj, R3SURFA_TrimOperation, value, R3TID_INTEGER, 0); 
  336. }
  337.  
  338. R3SURFA_InvertNormal = 406534;
  339. function SetR3SURFA_InvertNormal(value) {
  340.   R3Set(this.r3obj, R3SURFA_InvertNormal, value, R3TID_INTEGER, 0); 
  341. }
  342.  
  343. function GetR3SURFA_InvertNormal() {
  344.   return R3Get(this.r3obj, R3SURFA_InvertNormal, R3TID_INTEGER, 0); 
  345. }
  346.  
  347. R3SURFA_Complexity = 406536;
  348. function GetR3SURFA_Complexity() {
  349.   return R3Get(this.r3obj, R3SURFA_Complexity, R3TID_INTEGER, 0); 
  350. }
  351.  
  352. var R3FRSURF_UVOP_XOR = 0;
  353. var R3FRSURF_UVOP_AND = 1;
  354. var R3FRSURF_UVOP_OR = 2;
  355. var R3SURFPR_PERSPECTIVE = 0;
  356. var R3SURFPR_ORTHOGRAPHIC = 1;
  357.  
  358.  
  359. function r3Surface () { 
  360.    this.base = r3God;
  361.    if(arguments.length) {
  362.       this.base(R3CLID_SURFACE, arguments);
  363.    }
  364.    // Methods
  365.    this.RAYHIT=mR3SURFM_RAYHIT;
  366.    this.RAYHITOPT=mR3SURFM_RAYHITOPT;
  367.    this.RAYHITOPTM=mR3SURFM_RAYHITOPTM;
  368.    this.AXHITOPT=mR3SURFM_AXHITOPT;
  369.    this.LIGHTHIT=mR3SURFM_LIGHTHIT;
  370.    this.LIGHTHITOPT=mR3SURFM_LIGHTHITOPT;
  371.    this.LIGHTHITOPTM=mR3SURFM_LIGHTHITOPTM;
  372.    this.TRIM=mR3SURFM_TRIM;
  373.    this.AXTRIM=mR3SURFM_AXTRIM;
  374.    this.ORIGTRIM=mR3SURFM_ORIGTRIM;
  375.    this.EVALUATESURFACEPOINT=mR3SURFM_EVALUATESURFACEPOINT;
  376.    this.EVALUATEUV=mR3SURFM_EVALUATEUV;
  377.    this.QUERYPOSDATA=mR3SURFM_QUERYPOSDATA;
  378.    this.QUERYAXDATA=mR3SURFM_QUERYAXDATA;
  379.    this.QUERYSHADOWDATA=mR3SURFM_QUERYSHADOWDATA;
  380.    this.INITPOSDATA=mR3SURFM_INITPOSDATA;
  381.    this.INITAXDATA=mR3SURFM_INITAXDATA;
  382.    this.INITSHADOWDATA=mR3SURFM_INITSHADOWDATA;
  383.    this.REGISTERCACHECLASS=mR3SURFCM_REGISTERCACHECLASS;
  384.    this.CREATECACHE=mR3SURFCM_CREATECACHE;
  385.    this.DELETECACHE=mR3SURFCM_DELETECACHE;
  386.    this.RESETCACHE=mR3SURFCM_RESETCACHE;
  387.    this.ALLOCCACHE=mR3SURFCM_ALLOCCACHE;
  388.    this.FREECACHE=mR3SURFCM_FREECACHE;
  389.    this.INITCACHE=mR3SURFCM_INITCACHE;
  390.    this.GETHOLLOWNESS=mR3SURFM_GETHOLLOWNESS;
  391.    this.INCREASECACHE=mR3SURFCM_INCREASECACHE;
  392.    this.EVALUATEDERIVATE=mR3SURFM_EVALUATEDERIVATE;
  393.    this.NOSHADOWS=mR3SURFM_NOSHADOWS;
  394.    this.GETEXTFLAGS=mR3SURFM_GETEXTFLAGS;
  395.    this.SETEXTFLAGS=mR3SURFM_SETEXTFLAGS;
  396.  
  397.    // Attributes
  398.    this.GetRadius=GetR3SURFA_Radius;
  399.    this.SetRadius=SetR3SURFA_Radius;
  400.    this.GetMask=GetR3SURFA_Mask;
  401.    this.SetMask=SetR3SURFA_Mask;
  402.    this.GetMaskPoints=GetR3SURFA_MaskPoints;
  403.    this.SetMaskPoints=SetR3SURFA_MaskPoints;
  404.    this.GetCog=GetR3SURFA_Cog;
  405.    this.GetParent=GetR3SURFA_Parent;
  406.    this.SetParent=SetR3SURFA_Parent;
  407.    this.GetTrim=GetR3SURFA_Trim;
  408.    this.SetTrim=SetR3SURFA_Trim;
  409.    this.SetInvertUVTrim=SetR3SURFA_InvertUVTrim;
  410.    this.SetTrimOperation=SetR3SURFA_TrimOperation;
  411.    this.GetInvertNormal=GetR3SURFA_InvertNormal;
  412.    this.SetInvertNormal=SetR3SURFA_InvertNormal;
  413.    this.GetComplexity=GetR3SURFA_Complexity;
  414. }
  415.  
  416. r3Surface.prototype=new r3Frsurface;
  417. // r3surf.h_H